<template>
	<view class="content page" id="join_page">
		<status-bar title='提交预约'></status-bar>
		<backTop v-if='toTop'></backTop>
		<view class="join_form">
			<view class="form_list">
				<view class="form_item">
					<view class="form_t">姓名：</view>
					<input type="text" name="" v-model="myName" placeholder="请输入您的姓名" class="form_input" />
				</view>
				<view class="form_item">
					<view class="form_t">电话：</view>
					<input type="number" name="" v-model="myPhone" placeholder="请输入电话号码" class="form_input" />
				</view>
				<view class="form_item">
					<view class="form_t">行业：</view>
					<input type="text" name="" v-model="myJob" placeholder="请输入行业描述" class="form_input" />
				</view>
			</view>
			<view class="join_form_oper">
				<view  @click="toPage" class="btn9 thmeBorder thmeColor" :style="{'--color': color}">返回首页</view>
				<view class="btn10 thmeBg" @click="myJoin" :style="{'--color': color}">提交预约</view>
			</view>
		</view>
	</view>
</template>

<script>
	var that;
	export default{
		data(){
			return {
				color: getApp().globalData.color,
				toTop:false,
				myName:'',
				myPhone:'',
				myJob:'',
				staticUrl: this.staticUrl,
			}
		},
		onShow(){
			
		},
		onShareAppMessage(option) {			let shareData = uni.getStorageSync('shareData');			let vid = uni.getStorageSync('vid');			return {				title: shareData.title,				desc: shareData.desc,				path: '/pages/index/index?share_v_id=' + vid,				imageUrl: shareData.imageUrl			}		},
		onLoad(options) {
			that = this
		},
		onPageScroll(e){
			if(e.scrollTop > 200){
				that.toTop = true;
			} else {
				that.toTop = false
			}
		},
		methods:{
			toPage:function(){
				uni.navigateBack({
					delta:1
				})
			},
			myJoin:function(){
				if(that.myName == '' || that.myJob == '' || that.myPhone == ''){
					uni.showToast({
						icon:"none",
						title:"请填写完整信息！",
						duration:2000
					})
					return
				}
				that.$http.post({
					url: '/zzj_singleSaleApi/myJoin',
					data: {
						JName: that.myName,
						JIndustry: that.myJob,
						JMobile: that.myPhone,
					}
				}).then(res => {
					if(res.status){
						uni.showModal({
							showCancel: false,
							content: res.msg,
							confirmText:'返回首页',
							success: (res) => {
								if (res.confirm) {
									that.backHome()
								}
							}
						})
					} else {
						uni.showToast({
							icon: "none",
							title: res.msg,
							duration: 2000
						})
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.page{
		background-color: #F8F8F8;
		.join_form{
			.join_form_oper{
				width: 100%;
				position: fixed;
				bottom: 80upx;
				left: 0;
				text-align: center;
				view{
					margin: 0 20upx;
				}
				.btn9{
					height: 88upx;
				}
			}
			.btn9{
				width: 236rpx;
				height: 84rpx;
				line-height: 84rpx;
				border: 1px solid #ff4b4e;
				border-radius: 6px;
				background: #ffffff;
				appearance: none;
				-webkit-appearance: none;
				display: inline-block;
				font-size: 32rpx;
				font-family: "microsoft yahei";
				text-align: center;
				color: #ff4b4e;
			}
			.btn10{
				width: 240rpx;
				height: 88rpx;
				line-height: 88rpx;
				border: none;
				border-radius: 6px;
				background: #ff4b4e;
				appearance: none;
				-webkit-appearance: none;
				display: inline-block;
				font-size: 32rpx;
				font-family: "microsoft yahei";
				text-align: center;
				color: #ffffff;
			}
		}
	}
	
</style>
